solve & polyroot

solve(해 계산)
solve(5, 10) # 5x=10
A<-matrix(c(2, 3, 1, 1), ncol=2, byrow=T)
b<-matrix(c(8, 3), ncol=1)
solve(A, b) # 2x+3y=8, x+y=3
A<-matrix(c(1, -1, 1, 2, 4, 3, -1, 2, -3), ncol=3)
b<-c(1, 5, 3)
solve(A, b)
polyroot(다항식 계산)
polyroot(c(-2, 3, -2, 1)) # x^3-2x^2+3x-2=0
[1] 1.0+0.000000i 0.5+1.322876i 0.5-1.322876i